package cc.liyinghao.config;

import cc.liyinghao.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;


/**
 * admin-Security配置类
 */
@Configuration
@RequiredArgsConstructor
public class AdminSecurityConfig {

    private final UserService userService;

    @Bean
    public UserDetailsService userDetailsService() {
        // 获取登录用户信息
        return userService::loadUserByUsername;
    }
}
